package com.jos.appium;

import java.net.MalformedURLException;
import java.net.URL;

import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebElement;

import io.appium.java_client.windows.WindowsDriver;

public class WindowNotepad {

	public static void main(String[] args) {

		WindowNotepad model = new WindowNotepad();

		try {
			model.exce();
		} catch (Exception e) {
			e.printStackTrace();
		}

	}

	public void exce() throws MalformedURLException {
		DesiredCapabilities appCapabilities = new DesiredCapabilities();
		appCapabilities.setCapability("app", "C:/Windows/System32/notepad.exe");
		appCapabilities.setCapability("deviceName", "WindowsPC");
		appCapabilities.setCapability("platformName", "windows");
		WindowsDriver<RemoteWebElement> driver = new WindowsDriver<RemoteWebElement>(new URL("http://192.168.152.197:4723/wd/hub"),
				appCapabilities);
		// Control the AlarmClock app
		driver.findElementByClassName("Edit").sendKeys("This is some text");
	}

}
